use crate::resolver::config::Config;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChangelogHistory {
    /// 最顶部的标题
    pub title: String,
    /// 顶部简介
    pub desc: String,
    /// 版本列表
    pub versions: Vec<Version>,
    /// 规则配置
    pub config: Config,
    /// 是否反转提交信息。默认是从上到下，从旧到新
    pub rev_commit: bool,
}
/// 版本实体
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Version {
    /// tag 名称
    pub name: String,
    /// 代表该tag所在commit的提交时间
    pub time: i64,
    /// 提交类别列表
    pub sections: Vec<Section>,
}
/// 提交类别实体
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Section {
    /// 类别名称
    pub section: String,
    /// 每种类别中包含的提交记录列表
    pub commits: Vec<Commit>,
}
/// 提交记录实体
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Commit {
    /// commit id
    pub id: String,
    /// commit 提交信息
    pub message: String,
    /// 提交时间
    pub time: i64,
}
